#ifndef		__IIC_H
#define		__IIC_H

#include "sys.h"

#define 		IIC_SDA_GPIOx									GPIOB
#define			IIC_SDA_GPIO_Pin							GPIO_Pin_6
#define			IIC_SDA_GPIO_RCC							RCC_APB2Periph_GPIOB
#define			IIC_SDA_RCCPeriphClockcmd			RCC_APB2PeriphClockCmd


#define 		IIC_SCL_GPIOx									GPIOB
#define			IIC_SCL_GPIO_Pin							GPIO_Pin_7
#define			IIC_SCL_GPIO_RCC							RCC_APB2Periph_GPIOB	
#define			IIC_SCL_RCCPeriphClockcmd			RCC_APB2PeriphClockCmd

#define			IIC_SCLSDA_GPIO_RCC						RCC_APB2Periph_GPIOB		
	
	

#define  		IIC_SDA		 PBout(6)
#define  		IIC_SCL		 PBout(7)

#define			READ_SDA   GPIO_ReadInputDataBit(IIC_SDA_GPIOx,IIC_SDA_GPIO_Pin)


void IIC_Init(void);
void IIC_Start(void); 
void IIC_Stop(void);			
uint8_t IIC_Wait_Ack(void);
void IIC_Ack(void);
void IIC_NAck(void);
void IIC_Send_Byte(u8 data);
u8 IIC_Read_Byte(unsigned char ack);

#endif  // ___SOFTWARE_IIC
